# Maintainer: Adam Thiede <me@adamthiede.com>
pkgname=magic-wormhole-rs
pkgver=0.7.3
pkgrel=0
pkgdesc="Rust implementation of Magic Wormhole, with new features and enhancements"
url="https://github.com/magic-wormhole/magic-wormhole.rs"
license="EUPL-1.2-or-later"
arch="all"
makedepends="rust cargo cargo-auditable"
source="$pkgname-$pkgver.tar.gz::https://github.com/magic-wormhole/magic-wormhole.rs/archive/refs/tags/$pkgver.tar.gz"

builddir="$srcdir/magic-wormhole.rs-$pkgver"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 "$builddir"/target/release/wormhole-rs "$pkgdir"/usr/bin/wormhole-rs
}

sha512sums="
497e379d075fad0fa11fc204be83d0a9734bd1bedcc0b22f9b6999466bff2a618fa09316dc028722797468024784ae100f1c81ed93de1fe4e1194f4b83e58515  magic-wormhole-rs-0.7.3.tar.gz
"
